<?php
/* @var $this yii\web\View */
// $model

use backend\models\Admin;
use backend\models\ArticleCategory;
use backend\models\Goods;
use kartik\select2\Select2;
use yii\bootstrap\ActiveForm;
use yii\bootstrap\Html;
use yii\helpers\Url;
use yii\web\JsExpression;
use yii\widgets\LinkPager;

$this->title = "管理员列表";


$this->params['breadcrumbs'][]=$this->title;


$this->params['breadcrumbs'][]=[
    'label'=>'添加管理员',
    'url'=>['manager/signup'],
    'options'=>['class'=>'btn btn-default btn-warning']
];
$this->params['breadcrumbs'][]=[
    'label'=>'回收站',
    'url'=>['manager/recycle-bin'],
    'options'=>['class'=>'btn btn-warnging'],
];



?>



<div class="container table-responsive">

    <table class="table table-hover">
        <tr>
            <td width="10%">名称</td>
            <td>邮箱</td>
            <td>添加时间</td>
            <td>状态</td>
            <td>最后登录IP</td>
            <td>最后登录时间</td>
            <td>操作</td>
        </tr>
        <?php foreach($models as $model): ?>
            <tr>
                <td><?=$model->username?></td>
                <td><?=$model->email?></td>
                <td><?=date('y-m-d H:m:s',$model->created_at)?></td>
                <td><?=Admin::$StatusValue[$model->status]?></td>
                <td><?=$model->last_login_ip?></td>
                <td><?=date('y-m-d H:m:s',$model->last_login_time)?></td>
                <td>
                    <?=Html::a('编辑',['manager/edit','id'=>$model->id],['class'=>'btn btn-info'])?>
                    <?=Html::a('删除',['manager/del','id'=>$model->id],[
                        'class'=>'btn btn-danger',
                        'data'=>[
                            'confirm'=>'确认删除!',
                            'method'=>'post',
                        ],
                    ])?>
                </td>
            </tr>
        <?php endforeach;?>
    </table>

    <?=LinkPager::widget([
        'pagination'=>$pager,
        'prevPageLabel'=>'上一页',
        'nextPageLabel'=>'下一页',
    ])?>


</div>

<?php
/*
 *    $form = ActiveForm::begin();

echo $form->field(new Goods(), 'name' )->widget(Select2::classname(), [
    'name'=>'name',
    'options' => ['placeholder' => '请输入商品名称 ...','multiple'=>true ],
    'pluginOptions' => [
        'placeholder' => 'search ...',
        'allowClear' => true,
        'language' => [
            'errorLoading' => new JsExpression("function () { return 'Waiting...'; }"),
        ],
        'ajax' => [
            'url' => Url::to(['goods/search-title']),
            'dataType' => 'json',
            'data' => new JsExpression('function(params) { return {q:params.term}; }')
        ],
        'escapeMarkup' => new JsExpression('function (markup) { return markup; }'),
        'templateResult' => new JsExpression('function(res) { return res.text; }'),
        'templateSelection' => new JsExpression('function (res) { return res.text; }'),
    ],
]);

echo Html::submitButton('搜索',['class'=>'btn btn-info']);

    ActiveForm::end();
 */



?>


